home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 20 code / Advanced AOCE Templates / Planet.r < prev    next >
Encoding:
Text File  |  1994-09-23  |  7.3 KB  |  247 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Orbits.r
  3.  
  4.     Contains:    A set of templates to display (and calculate) the orbits of the planets.
  5.  
  6.     Written by:    Harry Chesley
  7.  
  8.     Copyright:    © 1992 by Apple Computer, Inc.
  9.  
  10.     Change History (most recent first):
  11.  
  12.                  5/13/92    hrc        created
  13.  
  14.     To Do:
  15. */
  16.  
  17. #include "Types.r"
  18. #include "OCE.r"
  19. #include "Planet.h"
  20.  
  21. include "Planet.rsrc" not 'ckid';
  22.  
  23. #define kPlanetAttributeType "hrc  Planet"
  24.  
  25. #define kPlanetMainAspect    10000
  26. #define kPlanetFrontPage    11000
  27. #define kPlanetParamsPage    12000
  28.  
  29. // Planet page size:
  30.  
  31. #define kPlanetPageHeight    (kDETSubpageIconBottom+112)
  32. #define kPlanetPageWidth    218
  33.  
  34. #define kPalatino 16
  35.  
  36. #define kFirstColLeft    8
  37. #define kFirstColRight    75
  38. #define kSecondColLeft    75
  39. #define kSecondColRight    (kPlanetPageWidth-12)
  40.  
  41.  
  42. resource 'deta' (kPlanetMainAspect, purgeable) {
  43.     0,                    // Priority (unused)
  44.     dropCheckConflicts,    // Drop check flag
  45.     isMainAspect        // Is the main aspect
  46. };
  47.  
  48. resource 'rstr' (kPlanetMainAspect+kDETTemplateName, purgeable) {
  49.     "hrc  Planet main aspect"
  50. };
  51.  
  52. resource 'rstr' (kPlanetMainAspect+kDETAttributeType, purgeable) {
  53.     kPlanetAttributeType
  54. };
  55.  
  56. resource 'detn' (kPlanetMainAspect+kDETAttributeValueTag, purgeable) {
  57.     'plnt'
  58. };
  59.  
  60. resource 'rstr' (kPlanetMainAspect+kDETAspectKind, purgeable) {
  61.     "Planet"
  62. };
  63.  
  64. resource 'rstr' (kPlanetMainAspect+kDETAspectWhatIs, purgeable) {
  65.         "Planet\n\This is a body that orbits a sun."
  66. };
  67.  
  68. resource 'rst#' (kPlanetMainAspect+kDETAspectCategory, purgeable) {
  69.     { "Celestial" }
  70. };
  71.  
  72. resource 'rstr' (kPlanetMainAspect+kDETAspectNewMenuName, purgeable) {
  73.     "Planet"
  74. };
  75.  
  76. #define extendedZero longInt = 0; longInt = 0; integer = 0
  77.  
  78. type 'detb' (kPlanetMainAspect+kDETAspectNewValue) {
  79.     longInt;
  80.     rstring;
  81.     extendedZero;    // Tp
  82.     extendedZero;    // epsilon
  83.     extendedZero;    // omega bar
  84.     extendedZero;    // e
  85.     extendedZero;    // a
  86. };
  87.  
  88. resource 'detb' (kPlanetMainAspect+kDETAspectNewValue, purgeable) {
  89.     'plnt',
  90.     "untitled planet"
  91. };
  92.  
  93. // attributes to lookup
  94. resource 'dett' (kPlanetMainAspect+kDETAspectLookup, purgeable)
  95.     {{
  96.     { kPlanetAttributeType }, 'plnt', useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  97.         {
  98.         'rstr', kDETAspectName,        0;
  99.         'btyp', kDETNoProperty,        kExtendedPropertyType;
  100.         'blok', kTpProperty,        kExtendedPropertyTypeSize;
  101.         'blok', kEpsilonProperty,    kExtendedPropertyTypeSize;
  102.         'blok', kOmegaBarProperty,    kExtendedPropertyTypeSize;
  103.         'blok', keProperty,            kExtendedPropertyTypeSize;
  104.         'blok', kaProperty,            kExtendedPropertyTypeSize;
  105.         };
  106.     }};
  107.  
  108. data 'detb' (kPlanetMainAspect+kTimeProperty, purgeable)
  109.     { $"0000 0000 0000 0000" };
  110.  
  111. data 'detb' (kPlanetMainAspect+kXProperty, purgeable)
  112.     { $"0000 0000 0000 0000 0000" };
  113.  
  114. data 'detb' (kPlanetMainAspect+kYProperty, purgeable)
  115.     { $"0000 0000 0000 0000 0000" };
  116.  
  117. resource 'rst#' (kPlanetMainAspect+kDETAspectBalloons, purgeable)
  118.     {{
  119.     "The planet's name.", "The planet's name. Cannot be edited because the user record is locked or you do not have privileges to make changes here.",
  120.     }};
  121.  
  122. resource 'detw' (kPlanetMainAspect+kDETAspectInfoPageCustomWindow, purgeable)
  123.     {
  124.     {0,0,kPlanetPageHeight,kPlanetPageWidth},
  125.     includePopup
  126.     };
  127.  
  128. resource 'deti' (kPlanetFrontPage, purgeable) {
  129.     1000,
  130.     kDETNoSublistRect,
  131.     noSelectFirstText,
  132.     {
  133.     kDETNoProperty, kDETNoProperty, kPlanetFrontPage;
  134.     },
  135.     {
  136.     }};
  137.  
  138. resource 'rstr' (kPlanetFrontPage+kDETTemplateName, purgeable) {
  139.     "hrc  Front page"
  140. };
  141.  
  142. resource 'rstr' (kPlanetFrontPage+kDETAttributeType, purgeable) {
  143.     kPlanetAttributeType
  144. };
  145.  
  146. resource 'detn' (kPlanetFrontPage+kDETAttributeValueTag, purgeable) {
  147.     'plnt'
  148. };
  149.  
  150. resource 'rstr' (kPlanetFrontPage+kDETInfoPageName, purgeable) {
  151.     "Orbit Calculation"
  152. };
  153.  
  154. resource 'rstr' (kPlanetFrontPage+kDETInfoPageMainViewAspect, purgeable) {
  155.     "hrc  Planet main aspect"
  156. };
  157.  
  158. // subPage view
  159.  
  160. resource 'detv' (kPlanetFrontPage, purgeable)
  161.     {
  162.     {
  163.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  164.     Bitmap { kDETLargeIcon };
  165.  
  166.     {kDETSubpageIconBottom+10, kFirstColLeft, kDETSubpageIconBottom+24, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  167.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "Time" };
  168.     {kDETSubpageIconBottom+6, kSecondColLeft, kDETSubpageIconBottom+24, kSecondColRight}, kDETEnabled, kTimeProperty,
  169.     EditText { kPalatino, 12, kDETLeft, kDETNormal };
  170.  
  171.     {kDETSubpageIconBottom+50, kFirstColLeft, kDETSubpageIconBottom+64, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  172.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "X (meters)" };
  173.     {kDETSubpageIconBottom+48, kSecondColLeft, kDETSubpageIconBottom+64, kSecondColRight}, kDETNoFlags, kXProperty,
  174.     StaticText { kPalatino, 12, kDETLeft, kDETNormal };
  175.  
  176.     {kDETSubpageIconBottom+70, kFirstColLeft, kDETSubpageIconBottom+84, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  177.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "Y (meters)" };
  178.     {kDETSubpageIconBottom+68, kSecondColLeft, kDETSubpageIconBottom+84, kSecondColRight}, kDETNoFlags, kYProperty,
  179.     StaticText { kPalatino, 12, kDETLeft, kDETNormal };
  180.     };
  181.     };
  182.  
  183. resource 'deti' (kPlanetParamsPage, purgeable) {
  184.     2000,
  185.     kDETNoSublistRect,
  186.     noSelectFirstText,
  187.     {
  188.     kDETNoProperty, kDETNoProperty, kPlanetParamsPage;
  189.     },
  190.     {
  191.     }};
  192.  
  193. resource 'rstr' (kPlanetParamsPage+kDETTemplateName, purgeable) {
  194.     "hrc  Params page"
  195. };
  196.  
  197. resource 'rstr' (kPlanetParamsPage+kDETAttributeType, purgeable) {
  198.     kPlanetAttributeType
  199. };
  200.  
  201. resource 'detn' (kPlanetParamsPage+kDETAttributeValueTag, purgeable) {
  202.     'plnt'
  203. };
  204.  
  205. resource 'rstr' (kPlanetParamsPage+kDETInfoPageName, purgeable) {
  206.     "Orbit Parameters"
  207. };
  208.  
  209. resource 'rstr' (kPlanetParamsPage+kDETInfoPageMainViewAspect, purgeable) {
  210.     "hrc  Planet main aspect"
  211. };
  212.  
  213. // subPage view
  214.  
  215. resource 'detv' (kPlanetParamsPage, purgeable)
  216.     {
  217.     {
  218.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  219.     Bitmap { kDETLargeIcon };
  220.  
  221.     {kDETSubpageIconBottom+10, kFirstColLeft, kDETSubpageIconBottom+24, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  222.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "Tp" };
  223.     {kDETSubpageIconBottom+6, kSecondColLeft, kDETSubpageIconBottom+24, kSecondColRight}, kDETEnabled, kTpProperty,
  224.     EditText { kPalatino, 12, kDETLeft, kDETNormal };
  225.  
  226.     {kDETSubpageIconBottom+30, kFirstColLeft, kDETSubpageIconBottom+44, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  227.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "Epsilon" };
  228.     {kDETSubpageIconBottom+26, kSecondColLeft, kDETSubpageIconBottom+44, kSecondColRight}, kDETEnabled, kEpsilonProperty,
  229.     EditText { kPalatino, 12, kDETLeft, kDETNormal };
  230.  
  231.     {kDETSubpageIconBottom+50, kFirstColLeft, kDETSubpageIconBottom+64, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  232.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "Omega bar" };
  233.     {kDETSubpageIconBottom+46, kSecondColLeft, kDETSubpageIconBottom+64, kSecondColRight}, kDETEnabled, kOmegaBarProperty,
  234.     EditText { kPalatino, 12, kDETLeft, kDETNormal };
  235.  
  236.     {kDETSubpageIconBottom+70, kFirstColLeft, kDETSubpageIconBottom+84, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  237.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "e" };
  238.     {kDETSubpageIconBottom+66, kSecondColLeft, kDETSubpageIconBottom+84, kSecondColRight}, kDETEnabled, keProperty,
  239.     EditText { kPalatino, 12, kDETLeft, kDETNormal };
  240.  
  241.     {kDETSubpageIconBottom+90, kFirstColLeft, kDETSubpageIconBottom+104, kFirstColRight}, kDETNoFlags, kDETNoProperty,
  242.     StaticTextFromView { kPalatino, 10, kDETLeft, kDETBold, "a" };
  243.     {kDETSubpageIconBottom+86, kSecondColLeft, kDETSubpageIconBottom+104, kSecondColRight}, kDETEnabled, kaProperty,
  244.     EditText { kPalatino, 12, kDETLeft, kDETNormal };
  245.     };
  246.     };
  247.